Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

same date and key with different data for

Hi,

when i try to create flag for the max date its not creating for the situation of same multiple date and same key

can i ksolve this issue

     

KEYDATEAMTYEAR_FLAGYear
key106012016100 2016
key106012016200 2016
7 Replies
manoranjan_d
Specialist
Specialist
Author

can any one reply me to my query

vinieme12
Champion III
Champion III

Please Post your expression you are trying to create the Flag with.

also you need to reformat your date field

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
santiago_respane
Specialist
Specialist

Hi!

How are you trying to create the flag?

Please elaborate more in order to be more helpful.

Kind regards,

manoranjan_d
Specialist
Specialist
Author

FACT:

KEY,

DATE,

AMT

FROM

XXXX;

YEAR:

LOAD

Distinct

  FirstSortedValue(KEY,-DATE) as KEY,

  date(Max(DATE),'YYYY') as  YEAR,

  'Y' as YEAR_FLAG

Resident FACT

Group By KEY

;

now in the chart if i use the expression as

expression 1:

if(GetSelectedCount(Year)>=1,sum({< YEAR_FLAG={'Y'}>}AMT)

expresion2:

if(GetSelectedCount(Year)>=1,count({< YEAR_FLAG={'Y'}>}KEY)

manoranjan_d
Specialist
Specialist
Author

can any one reply me

PrashantSangle

Hi,

what is your expected output??

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

Are you looking for below output

Capture.PNG

There might be multiple solution one of it below

Test:

LOAD * INLINE [

    Key, Date, Amt , Year

    key1, 06012016, 100, 2016

    key1, 06012016, 200, 2016

    key2, 06022016, 200, 2016

];

join

Load Key as Key,

Date as Date,

max(Amt) as Amt,

Year as Year,

'maxFlag' as Flag

Resident Test

group by Key,Date,Year;

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂