Sunday, January 31, 2021

Power Query - dCalendar Hour DIM_Horario

let

    vBinary = "bc+9DYAgFATgXagt+FeG0MqOUJBg1EYToxM5iosJUpl7zd3l6857xlnD+piOa44p5i1YaHxOSiWpilRNqiHVfrotz52H/KhF6pAckuCECcLKmTEeacqtKikkjWSQLFKLVA4M+3oW0pUckORIAkkiqT+FFw==",

    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(vBinary, BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hora = _t, Turno = _t, Column1 = _t]),

    Step01 = Table.RenameColumns(Source,{{"Column1", "Nivel"}}),

    Step02 = Table.AddColumn(Step01, "TurnoNivel", each [Nivel] & " - " & [Turno]),

    Step03 = Table.TransformColumnTypes(Step02,{{"Hora", Int64.Type}, {"Turno", type text}})

in

    Step03

Python - Environment ...

 #Commands 

conda --version 

python --version 

conda info –envs 

conda env list 

conda search tensorflow  

jupyter notebook 


#Install/Uninstall Commands 

conda install --help (...)  

conda remove -n py3 --all -y 


#IMPORT Environment 

conda create --name py3  

conda deactivate 

conda activate py3 

source activate py3 (validar...) 

conda env update --file "C:\Users\YouUSER\Ambientes_Python\py3.yml" --prune 


#EXPORT Environment 

conda env export -f "C:\Users\YouUSER\Ambientes_Python\py3.yml" 


#Machine Environment 

C:\Users\YouUSER\Anaconda3

C:\Users\YouUSER\Anaconda3\Library\mingw-w64\bin

C:\Users\YouUSER\Anaconda3\Scripts

C:\Users\YouUSER\Anaconda3\Library\bin


Monday, January 18, 2021

Power Query - List IN

 

  #"Added custom1" = Table.AddColumn(#"Changed column type", "VP"each 
  if (List.Contains({"ZNLD","ZNLM"},[DOC_TYPE]) and 
    (List.Contains({"5","6","8","9"},Text.Middle(Text.Replace([#".NIF_Venda"], "PT"""), 31)))
    )  then "E" //Empresa
    else if (List.Contains({"ZNLD","ZNLM"},[DOC_TYPE]) and 
         not(List.Contains({"5","6","8","9"},Text.Middle(Text.Replace([#".NIF_Venda"], "PT"""), 31)))
         )  then "P"  //Pessoal
         else if List.Contains({"ZOTP","ZREP","ZG2P","ZGCP"},[DOC_TYPE]) then "F"  //Frota
         else "?")
in
  #"Added custom1"


OR....

  #"Filtered rows 1" = Table.SelectRows(#"Changed column type", each (List.Contains({1100001590,1100001591,1100001639,1100001640,1100001642,1100001643,1100001644,1100001645,1100001646,1100001647,1100001648,1100001649},[#"/BIC/ZMATERIAL"])))
in
  #"Filtered rows 1"

Power BI APP - Delete or Unpublish

 UNPUBLISH DELETE