Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
prahlad_infy
Partner - Creator II
Partner - Creator II

Sir , assisti please in creating flag in script for all dates which falls in ranger from today to last one year

Helo Gurus ,

I have never worked on  xTD data . Please helping in creating flag in script for all dates which fall in ranger from today to last one year .

for emaple if today is 21 march then date from 21 marcg 2017 to 21march 2018 should have flag as 1 .

thank you all in advance .  Please share script , i am not with licence .

3 Replies
Anil_Babu_Samineni

May be this?

Let Variable = Max(Date);

Load_Table:

Load Medicine, If(Date>='$(Variable)' and Date<=AddYears('$(Variable)', -1), 1, If(Date>='$(Variable)' and Date<=AddYears('$(Variable)', -2), 2, If(Date>='$(Variable)' and Date<=AddYears('$(Variable)', -3), 3, ...) as Flag, Date, Sale From Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
prahlad_infy
Partner - Creator II
Partner - Creator II
Author

Sir can you share screen shot , i am facing problem with date filed . All date are not come proper

Anil_Babu_Samineni

Can you try this Front-End and start selection and see whether it is giving anything?

If(Date>=AddYears(Max(TOTAL Date),-1) and Date<=Max(TOTAL Date),1, If(Date>=AddYears(Max(TOTAL Date),-2) and Date<=Max(TOTAL Date),2,3))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful