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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find out status?

Hi community,

- please refer below sampale data

Primary_Acct, Secondary_Acct, Final_Acct,Status

1                    -                         1                Live   

2                    3                         3              Close

3                    5                         5               Close

4                    6                         6                Live   

5                    7                         7                Close

6                    9                         9                Live

7                    8                         8                Close

8                    -                          8               Live

9                    -                          9               Live  

10                  -                          10              Live

- I have this kind of data i want below output

1) if Primary_Acct Status is Live then show Final_Acct is Primary_Acct and Status of Primary_Acct.

2) if Primary_Acct Status is Close but present Secondary_Acct against Primary_Acct then show Final_Acct is Secondary_Acct and      Status of Secondary_Acct .

- when I have applied some logic and above conditions i got below output till Fina_Acct is correct but i didn't got Status.

so how i will get correct status?

Primary_Acct, Secondary_Acct, Final_Acct,Status

1                    -                         1                Live   

2                    3                         3               Live

3                    5                         5               Close

4                    6                         6               Live   

5                    7                         7               Live

6                    9                         9               Live

7                    8                         8               Close

8                    -                          8               Close

9                    -                          9               Live  

10                  -                          10              Live

Thanks in advance.

8 Replies
senpradip007
Specialist III
Specialist III

In your sample data, what is the Secondary Status?

senpradip007
Specialist III
Specialist III

Have a look at this. May be help you.

PrashantSangle

Hi,

considering Primary_Acct,Scondary_Acct and Status is from same table

then try below code

Load Primary_Acct,

Secondary_Acct,

Status,

If(wildmatch(Status,'Live'),Primary_Acct,Secondary_Acct) as Final_Acct

From TableName;

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 🙂
Anonymous
Not applicable
Author

may be like this?

Load

*,

if(Status='Live', Primary_Acct,Secondary_Acct) as FinalAccount

from

Table;

Not applicable
Author

Hi Pradip,Max,Balraj

Thank u for your reply.

1) i want logic in front End not in Edit scripte because i can not change any linking which is done by prevoiuse developer.

2) i want below status in Status field

if Primary_Acct  field status is Live then Status should be Live and if  Primary_Acct field status is close but Secondary_Acct field status is Live then Status it should be Live and Final_Acct should be Secondary_Acct.

senpradip007
Specialist III
Specialist III

As per your data, there is no status for Secondary Account. Please sent the proper data so that we can help you.

Not applicable
Author

Hi Pradip,

1) I got only Primary_Acct and Secondary_Acct excel file data.

2) I mapped that with my account master table and i got Final_Acct field in front end.

3) I have also mention this in my expected output.

Please refere below expected output


Primary_Acct, Secondary_Acct, Final_Acct,Status

1                    -                         1                Live  

2                    3                         3               Live     - Here Secondary account status is Live

3                    5                         5               Close

4                    6                         6               Live  

5                    7                         7               Live    - Here Secondary aacount status is Live

6                    9                         9               Live

7                    8                         8               Close

8                    -                          8               Close

9                    -                          9               Live 

10                  -                          10              Live

Not applicable
Author

Hi Every one,

Thanks for your reply.

I got solution of my question.

First i brought  primary account status and then secondary account status.

Then i got final account status.