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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Logic help require

Hi All,

I have attached the excel file for logic I need. Please help me to achieve the same. Front end solution would be my first preference, but script solution also I would look.

7 Replies
Not applicable
Author

vinieme12
Champion III
Champion III

Your explanation in the excel file didn't make any sense to me, can you explain in a bit more detail?

Can you explain row wise operation? or ID wise for ID 2?

For ID 1, check sub ID = ID+2 i.e 3   << which row is this operation referring to ? why ID+2 why not ID+1/3/4???

.. Now for subid 3  << why didn't we check anything for SubID 2??

go back to 1 step back 2 i.e ID= subid 3-1=2 , So pick the row, where ID=2 and Sub ID=3, like wise for all ID, same logic will work

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

First I need to check, sub id, so for ID=1 (subid= ID+2 i.e 1+2=3).. 2 is constant addition for all ID, for ID =2, need to check sub id (subid=ID+2 i.e 2+2=4). Now I get the subid =3 for ID=1, now we go back to 1 step back from subid to check ID, so ID= subid-1 i.e 3-1=2

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Sorry, I don't understand it at all. Can you write out the entire algorithm as pseudo code?


talk is cheap, supply exceeds demand
vinieme12
Champion III
Champion III

Try below

Fact:

LOAD ID,

     SubID,

     Value,

     (ID+1)&'_'&(ID+2) as KEY

FROM

(ooxml, embedded labels, table is Sheet1);

left Join (Fact)

LOAD 

     (ID)&'_'&(SubID) as KEY,

  Value as Value2

FROM

(ooxml, embedded labels, table is Sheet1);

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

Hi,

another solution might be:

QlikCommunity_Thread_245830_Pic1.JPG

tabTest:

LOAD ID,

    SubID,

    Value

FROM [https://community.qlik.com/servlet/JiveServlet/download/1191339-260652/test.xlsx] (ooxml, embedded labels, table is Sheet1, filters(Remove(Row, Pos(Top, 22)),Remove(Row, Pos(Top, 21)),Remove(Row, Pos(Top, 20)),Remove(Row, Pos(Top, 19)),Remove(Row, Pos(Top, 18))));

tabOutput:

Left Keep

LOAD ID-1 as ID,

    Value as OutputValue

Resident tabTest

Where SubID=ID+1;

hope this helps

regards

Marco

Kushal_Chawda

Another option is to use front end expression with data Island table

Data:

LOAD ID,

     SubID,

     Value

FROM

[test.xlsx]

(ooxml, embedded labels, table is Sheet1);

ID:

LOAD Distinct ID as ID_new

Resident Data;

Create straight table

Dimension:

ID_new


Expression:

=sum(if(ID=ID_new+1 and SubID=ID_new+2, Value))