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: 
krishna20
Specialist II
Specialist II

month start status and month end status

Hi Friends,

i have an requirement from client side

that is

      

ACCOUNT_IDPRODUCT_IDPRODUCT_METRICS_DIMENSION_IDSOURCE_PRODUCT_METRICS_AIDSTART_DATEEND_DATEPREV_FOR_STATUSCURR_FOR_STATUS
397,3941,2861,512,649a0E26000000qAhrEAE12/10/201512/20/2015In ProgressRejected
397,3941,2861,512,649a0E26000000qAhrEAE12/21/201512/25/2015RejectedApproved

above the data is in put

i want out put like Below

397,3941,2861,512,649a0E26000000qAhrEAE12/10/201512/25/2015In ProgressApproved

could any one have a solution Kindly reply

Thanks

5 Replies
MK_QSL
MVP
MVP

What is the logic behind this?

Do you want to do this at front end or back end?

krishna20
Specialist II
Specialist II
Author

i want to do in back end

the logic behind this

one account and product combination there multiple status

but we need min months start date status and max month end status

if you want i can share my sample qvw

Thanks,

krishna20
Specialist II
Specialist II
Author

Hi

find the Attached which contains sample data and qvw

Thanks

Anonymous
Not applicable

Hi,

derive the month end dates and month start date from your date filed.....

like...MonthEnd(Your Date field)

MonthStart(Your Date Filed)

then these dates in front end.

dmitrydv
Contributor II
Contributor II

I try to help you with your issue.

I think, the solution is to take one part of the data and then to add the other fields to the first part of the data into the results table.

help-01_Result.PNG

tmpTable:

LOAD

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID,

START_DATE,

END_DATE,

PREV_FOR_STATUS,

CURR_FOR_STATUS

FROM

[Data for kam formularity.xlsx]

(ooxml, embedded labels, table is [limited data]);

tmp1:

LOAD

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID,

Min(START_DATE) as START_DATE

Resident tmpTable

GROUP BY

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID;

LEFT JOIN (tmp1)

LOAD

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID,

START_DATE,

PREV_FOR_STATUS

RESIDENT tmpTable;

tmp2:

LOAD

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID,

Max(END_DATE) as END_DATE

Resident tmpTable

GROUP BY

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID;

LEFT JOIN (tmp2)

LOAD

ACCOUNT_ID,

PRODUCT_ID,

PRODUCT_METRICS_DIMENSION_ID,

SOURCE_PRODUCT_METRICS_AID,

END_DATE,

CURR_FOR_STATUS

RESIDENT tmpTable;

LEFT JOIN (tmp1)

LOAD * RESIDENT tmp2;

DROP Tables tmpTable, tmp2;

RENAME Table tmp1 to Result;