Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
s_gorgo
Contributor II
Contributor II

How to replace a set analysis string in load script editor

Hello,

I need your help! I'd like to understand how to replace a set analysis string in load script editor.

The field I would like to add directly to the table "tab_MASTER_ORDINI" is the following:

Count({$<Data = {">=$(=[DataValidazioneVenerdì]) <=$(=[DataConsegnaRichiestaVenerdìMeno])"}, GgLav={"1"}>} Data) as GgLavValidazione

The field permit me to know the number of working days (custom calendar) betxween two dates.

  • field Data --> table Calendario
  • field DataValidazioneVenerdìDataConsegnaRichiestaVenerdìMeno --> table tab_MASTER_ORDINI

Database:

struttura.png

tab_MASTER_ORDINI (.accdb file): 

LIB CONNECT TO 'K--DiPR-PPlan-_PPlan-DB_produzione.accdb';

LOAD Autore,
AutoreModifica,
Cliente,
CodiceCliente,
[...]
SettimanaMAD,
SettimanaMontaggio,
Stato,
StatoODP,
TipoOrdine,
TM,
UDM,
If (TipoOrdine = 'KD', 'pianificato', If(TipoOrdine = 'ZCAB', 'mobili', 'generici')) as StatoOrdine,
If (isnull(DataConsegnaRichiesta),'noDateReq',If (MAD <= DataConsegnaRichiesta, 'onTime', 'onDelay')) as Validazione,
Date(WeekEnd(DataValidazione)-2,'DD/MM/YYYY') as DataValidazioneVenerdì,
Date(WeekEnd(DataConsegnaRichiesta)-2,'DD/MM/YYYY') as DataConsegnaRichiestaVenerdì,
Date(WeekStart(DataConsegnaRichiesta)-3,'DD/MM/YYYY') as DataConsegnaRichiestaVenerdìMeno;
SQL SELECT Autore,
AutoreModifica,
Cliente,
CodiceCliente,
[...]
SettimanaMAD,
SettimanaMontaggio,
Stato,
StatoODP,
TipoOrdine,
TM,
UDM
FROM `tab_MASTER_ORDINI`;

 

How can I insert field "GgLavValidazione" directly in the table?

Thank you so much!!!! 😉

Labels (3)
11 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi, 

 

I'm glad you are satisfied with the resolution!

Not sure that's going to work as is but you can do Date(Floor([DataField])) to make it a 'regular' Date.

That's a tricky topic in QV, you can check the Date() and Date#() functions.

 

Kind regards,

S.T.

s_gorgo
Contributor II
Contributor II
Author

I don't know why, but:

  • Weekend function return "Date and Time" data format;
  • Weekstart function return "Date" data format.

At least in my app 😅