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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Differnt age

hi all!

I have perhaps a smaller problem but I have tried a lot of different  formula and the didn´t work.

I want to have <30 days and new column 31-90 91-180 and bigger then 365.

my formula is.

(today () - DATUM >='91',

if (today () - DATUM <= '180',

IF(ENH='KG' , (DISP1*TJOCKLEK_2*SPEC_VIKT)* KOSTPRIS))

IF(ENH='M2' , (DISP1* KOSTPRIS)))


Labels (1)
11 Replies
anbu1984
Master III
Master III

Can you explain your requirement with sample data.

MK_QSL
MVP
MVP

Load

  DATUM,

  IF(Diff < 30, '0-30',

  IF(Diff > 30 and Diff < 90, '31-90',

  IF(Diff > 90 and Diff < 180, '91-180',

  IF(Diff > 180 and Diff < 365, '181-365', '365+')))) as DifferenceRange;

Load

  DATUM,

  Interval(Today() - DATUM,'d') as Diff

Inline

[

  DATUM

  01/01/2013

  24/05/2013

  25/08/2013

  31/01/2013

  25/05/2014

  30/05/2014

  25/07/2014

  10/09/2014

];

Not applicable
Author

hi

I have coil in stock and the are in  m2 and kg.

they arrived in different  days .

so I want to have them in different columns

  coil     unit           date                        column 1   column 2     column 3   column4

                                                               <30         31>90            91>180     >365

5400   kg        2014-08-01                                         5400

4500   kg        2014-09-20                        4500

Not applicable
Author

HI


Better you can create Flag in script level:


if(interval(today()-DATUM,'d')<30,'below 30',

  interval(today()-DATUM,'d')>=31 and interval(today()-DATUM,'d')<90,'31 To 90'

  interval(today()-DATUM,'d')>=91 and interval(today()-DATUM,'d')<180.'91To180',

   interval(today()-DATUM,'d')>=181 and interval(today()-DATUM,'d')<360,'181 To 360','Above 360') as Flag


Then make use in set analysis Flag value


Not applicable
Author

thanks' I try and come back.

Not applicable
Author

hi

as you can see formula is not working.

(interval(today()-DATUM)<30,'below 30',

 
interval(today()-DATUM)>=31 and interval(today()-DATUM)<90,'31 To 90'

  interval(today()-DATUM)>=91 and interval(today()-DATUM<180).'91To180','Above 180') as Flag

Not applicable
Author

Hi Bengt,

just try with changing interval(today()-DATUM,'d')

please let me know if it work or not.

regards,

harshal

demoustier
Creator
Creator

some 'if' missing:

try:

if(interval(today()-DATUM)<30,'below 30',

if (interval(today()-DATUM)>=31 and interval(today()-DATUM)<90,'31 To 90',

if( interval(today()-DATUM)>=91 and interval(today()-DATUM<180),'91To180','Above 180') as Flag

Not applicable
Author

Hi Harshal!

Yes this one work´s .

I have use today () - DATUM

And I got the same result.

//Bengt