Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
dhavalvyas
Contributor III
Contributor III

Set limit for mobile number

Hi,

I have mobile number field in my table from which I want to store only valid mobile number in. Csv file. Mobile number should be 10 number only. If greater or less than 10 then it will not store in.  Csv

What logic should I apply???

7 Replies
vishsaggi
Champion III
Champion III

What are the values that comes in your mobilenumber field. May be try like:

IF(Len(Trim(MobileNumber)) = 10, MobileNumber, 0) AS ValidMobileNum

Anil_Babu_Samineni

May be this?

Fact:

Load * From Table;

If Len(Mnum) = 10 THEN

STORE Fact into ....;

EndIf

MsgBox ("Not storing");

Next;

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
prieper
Master II
Master II

IF(LEN(TRIM(MyMobile)) = 10 AND ISNUM(LEN(TRIM(MyMobile)), LEN(TRIM(MyMobile))) AS ValidMobile

dhavalvyas
Contributor III
Contributor III
Author

My application also contain policy no. field.users requirement is that on daily refreshing data same policy no. and mobile no. does not repeat or exist  for next seven(7) days.

so what should logic I apply for this scenario ???

vishsaggi
Champion III
Champion III

Can you explain a little more with an example data and you expected value should be?

dhavalvyas
Contributor III
Contributor III
Author

In my application there is many fields out of which i wnat only two fields i.e. policy no. and mobile no.,want to store only these two fields into csv.

1> In which mobile no should be only 10 digit if more or less than 10 then it should not store into csv

2> Also same policy no. and Mobile no. should not repeat for next seven(7) days.

after doing these two conditions it should be daily refreshed and get  store into sql.

can you tell me step by step process for it ???

its_anandrjs

Try some this and let me know if there is any date field also also can you share some data to have a look i have some idea then share with you. Then let me know if it is worked for you.

I am taking resident load of your main table and extract only policy no, mobile no but it is not for seven days. Initially it is full loading and after that you have to check it by incremental load.

FirstTab:

Load

Policy_No&'-'&MobileNO as Key

Policy_No,

MobileNO

From FactTable

Where Len(MobileNO) = Right(MobileNO,10);

Store FirstTab into FirstTab.qvd(qvd);

Final:

Load

Policy_No&'-'&MobileNO,

Policy_No,

MobileNO

From FirstTab.qvd Where Not Exists(Key,Policy_No&'-'&MobileNO);


Store Final into Final.qvd;